function login() {

	if (reimburse.staffId.value == "") {
		alert("请输入员工编号！！！");
		reimburse.staffId.focus();
		return false;
	}
	if (reimburse.typeId.value == "") {
		alert("请输入报销类型！！！");
		reimburse.typeId.focus();
		return false;
	}

	var star = document.getElementById("reimburseStar").value;
	if ($.trim(star).length == 0) {
		alert("请输入开始时间！！！");
		return false;
	}
	var end = document.getElementById("reimburseEnd").value;
	if ($.trim(end).length == 0) {
		alert("请输入结束时间！！！");
		return false;
	}

	var reimburseAmount = document.getElementById("reimburseAmount").value;
	if ($.trim(reimburseAmount).length == 0) {
		alert("请输入报销金额！！！");
		return false;
	}

	if (reimburse.handId.value == "") {
		alert("请选择是否需要上交发票！！！")
		reimburse.handId.focus();
		return false;
	}

	var reimburseAmountPayable = document
			.getElementById("reimburseAmountPayable").value;
	if ($.trim(reimburseAmountPayable).length == 0) {
		alert("请输入应交发票金额！！！");
		return false;
	}

	var reimburseAmountPaid = document.getElementById("reimburseAmountPaid").value;
	if ($.trim(reimburseAmountPaid).length == 0) {
		alert("请输入未交发票金额！！！");
		return false;
	}

	if (reimburse.statusId.value == "") {
		alert("请输入报销状态！！！");
		reimburse.statusId.focus();
		return false;
	}

	return true;
}

// 验证是否符合数字格式

function checkstaffId() {
	var staffId = document.getElementById("staffId").value;
	var regu = "^[0-9]+$";
	if (staffId.search(regu) != -1) {
		if (isStaffExist(staffId)) {
			return true;
		} else {
			alert("员工编号不存在");
			return false;
		}
	} else {
		alert("请将员工编号输入为数字！！！");
		return false;
	}
}

function checkreimburseAmountPayable(){
	var reimburseAmountPayable=document.getElementById("reimburseAmountPayable").value;
	var regu = "^[0-9]+$"; 
	if (reimburseAmountPayable.search(regu) != -1) { 
		return true; 
} 
	else { 
		alert("请将应交发票金额输入为数字！！！");
		return false; 
} 
}

function checkreimburseAmount(){
	var reimburseAmount=document.getElementById("reimburseAmount").value;
	var regu = "^[0-9]+$"; 
	if (reimburseAmount.search(regu) != -1) { 
		return true; 
} 
	else { 
		alert("请将报销金额输入为数字！！！");
		return false; 
} 
}

function checkreimburseAmountPaid(){
	var reimburseAmountPaid=document.getElementById("reimburseAmountPaid").value;
	var regu = "^[0-9]+$"; 
	if (reimburseAmountPaid.search(regu) != -1) { 
		return true; 
} 
	else { 
		alert("请将已交发票金额输入为数字！！！");
		return false; 
} 
}

function isStaffExist(staffId){
	var flag = false;
	var fn = function(result){
		flag = result;
	}
	dwr.engine.setAsync(false);
	checkStaffService.isExist(staffId,fn);
	dwr.engine.setAsync(true);
	return flag;
}